#syntax=docker/dockerfile:1.3-labs
ARG IMAGE_REPO=docker.io/library
ARG JDK_VERSION=1.8
# From JDK
FROM ${IMAGE_REPO}/jdk-devel:${JDK_VERSION}  
ARG SCALA2_VERSION=2.13.10
ENV SCALA_HOME=/opt/scala
ENV PATH=$PATH:$SCALA_HOME/bin 
RUN curl -LO https://downloads.lightbend.com/scala/${SCALA2_VERSION}/scala-${SCALA2_VERSION}.tgz && \
    mkdir -p ${SCALA_HOME} && \
    tar -zxvf scala-${SCALA2_VERSION}.tgz --strip-components=1 -C ${SCALA_HOME} && \
    rm -f scala-${SCALA2_VERSION}.tgz
RUN \
    echo "SCALA_HOME=${SCALA_HOME}" >>/root/.bashrc && \
    sed -i "$(awk '/export PATH=.*/{print NR}' ~/.bashrc)s,.*,export PATH=${PATH},g" /root/.bashrc
# CMD [ "/usr/sbin/sshd" ]


